Testing output of the coding.

## Loading the packages and setting adjustment
suppressMessages(source('function/libs.R'))
  1. DT, 2. DT, 3. DT: #DT
## Read the datasets Refer to **Testing efficiency of coding.Rmd** at chunk
## `get-data-summary-table-2.1`
years <- seq(2011, 2015)

## Here I take the majority leagues setting profile which are 'league-10-12'
## fMYPriceB = Back with vigorish price; fMYPriceL = Lay with vigorish price
## Here we term as Fair Odds
lProfile <- c(AH = 0.1, OU = 0.12)

mbase <- readfirmDatasets(years = years) %>% arrfirmDatasets(., lProfile = lProfile)

## In order to analyse the AHOU, here I need to filter out all soccer matches
## other than AHOU. (For example : Corners, Total League Goals etc.)  the
## stakes amount display as $1 = $10,000
#'@ mbase$datasets[!(mbase$datasets$Home %in% mbase$corners)|!(mbase$datasets$Away %in% mbase$corners),]
dat <- mbase$datasets %>% filter((!Home %in% mbase$others) | (!Away %in% mbase$others)) %>% 
    mutate(Stakes = Stakes/10000, Return = Return/10000, PL = PL/10000, Month = month(ymd(Date), 
        label = TRUE))

#'@ pander(head(dat)) # exactly same layout with kable(x)
#'@ kable(head(dat)) ## example of the dataset in the research paper

dat %>% datatable(., caption = "Table 2.1.1 : Firm A Staking Data", extensions = c("ColReorder", 
    "ColVis", "TableTools"), options = list(dom = "TC<\"clear\">rlfrtip", colVis = list(exclude = c(0), 
    activate = "mouseover"), tableTools = list(sSwfPath = copySWF(pdf = TRUE)), 
    scrollX = TRUE, scrollCollapse = TRUE))

rm(years, readfirmDatasets, arrfirmDatasets)
rm(mbase)  ## We need to scrap the livescore data based on the raw data mbase without filter, but this is not the point in this research paper.

Please refer to Natural Language Analysis to see the firm A staking sample dataset.

summary(lm(Return ~ pHKRange, data = dat))

Call:
lm(formula = Return ~ pHKRange, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
 -63.00  -37.79  -17.25   12.27 2932.12 

Coefficients:
                  Estimate Std. Error t value Pr(>|t|)
(Intercept)         62.000     79.381   0.781    0.435
pHKRange(0.2,0.3]  -41.836     97.222  -0.430    0.667
pHKRange(0.3,0.4]  -41.708     80.893  -0.516    0.606
pHKRange(0.4,0.5]  -38.831     79.551  -0.488    0.625
pHKRange(0.5,0.6]  -33.688     79.414  -0.424    0.671
pHKRange(0.6,0.7]  -32.608     79.390  -0.411    0.681
pHKRange(0.7,0.8]  -24.209     79.386  -0.305    0.760
pHKRange(0.8,0.9]   -2.116     79.386  -0.027    0.979
pHKRange(0.9,1]      1.002     79.386   0.013    0.990
pHKRange(1,1.1]     -8.396     79.387  -0.106    0.916
pHKRange(1.1,1.2]  -29.750     79.389  -0.375    0.708
pHKRange(1.2,1.3]  -40.504     79.394  -0.510    0.610
pHKRange(1.3,1.4]  -48.593     79.410  -0.612    0.541
pHKRange(1.4,1.5]  -50.162     79.447  -0.631    0.528
pHKRange(1.5,1.6]  -51.549     79.547  -0.648    0.517
pHKRange(1.6,1.7]  -51.870     79.758  -0.650    0.515
pHKRange(1.7,1.8]  -41.994     80.392  -0.522    0.601
pHKRange(1.8,1.9]  -49.856     81.088  -0.615    0.539
pHKRange(1.9,2]    -41.814     82.167  -0.509    0.611
pHKRange(2,2.1]    -62.000    112.262  -0.552    0.581
pHKRange(2.1,2.2]  -58.950     88.751  -0.664    0.507
pHKRange(2.2,2.3]  -17.440     86.958  -0.201    0.841
pHKRange(2.3,2.4]  -24.500     97.222  -0.252    0.801
pHKRange(2.4,2.5]  -56.000     84.862  -0.660    0.509
pHKRange(2.5,2.6]  -49.000     97.222  -0.504    0.614
pHKRange(2.6,2.7]   51.305    112.262   0.457    0.648
pHKRange(2.7,2.8]   68.500    112.262   0.610    0.542
pHKRange(2.8,2.9]  -62.000    112.262  -0.552    0.581
pHKRange(2.9,3]    -52.000    112.262  -0.463    0.643
pHKRange(3.3,3.4]  -62.000    112.262  -0.552    0.581
pHKRange(3.7,3.8]  -61.000    112.262  -0.543    0.587
pHKRange(3.8,3.9]  -62.000    112.262  -0.552    0.581

Residual standard error: 79.38 on 48608 degrees of freedom
Multiple R-squared:  0.03839,   Adjusted R-squared:  0.03778 
F-statistic:  62.6 on 31 and 48608 DF,  p-value: < 2.2e-16

DT

Table summary

summary(lm(Return ~ HCap, data = dat))

Call:
lm(formula = Return ~ HCap, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
 -62.48  -41.85  -24.78   13.29 2951.13 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  48.7248     0.4667  104.41   <2e-16 ***
HCap         -3.9289     0.2679  -14.67   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 80.75 on 48638 degrees of freedom
Multiple R-squared:  0.004403,  Adjusted R-squared:  0.004383 
F-statistic: 215.1 on 1 and 48638 DF,  p-value: < 2.2e-16

graph 3.4.1b linear model

summary(lm(Return ~ pHKRange, data = dat))

Call:
lm(formula = Return ~ pHKRange, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
 -63.00  -37.79  -17.25   12.27 2932.12 

Coefficients:
                  Estimate Std. Error t value Pr(>|t|)
(Intercept)         62.000     79.381   0.781    0.435
pHKRange(0.2,0.3]  -41.836     97.222  -0.430    0.667
pHKRange(0.3,0.4]  -41.708     80.893  -0.516    0.606
pHKRange(0.4,0.5]  -38.831     79.551  -0.488    0.625
pHKRange(0.5,0.6]  -33.688     79.414  -0.424    0.671
pHKRange(0.6,0.7]  -32.608     79.390  -0.411    0.681
pHKRange(0.7,0.8]  -24.209     79.386  -0.305    0.760
pHKRange(0.8,0.9]   -2.116     79.386  -0.027    0.979
pHKRange(0.9,1]      1.002     79.386   0.013    0.990
pHKRange(1,1.1]     -8.396     79.387  -0.106    0.916
pHKRange(1.1,1.2]  -29.750     79.389  -0.375    0.708
pHKRange(1.2,1.3]  -40.504     79.394  -0.510    0.610
pHKRange(1.3,1.4]  -48.593     79.410  -0.612    0.541
pHKRange(1.4,1.5]  -50.162     79.447  -0.631    0.528
pHKRange(1.5,1.6]  -51.549     79.547  -0.648    0.517
pHKRange(1.6,1.7]  -51.870     79.758  -0.650    0.515
pHKRange(1.7,1.8]  -41.994     80.392  -0.522    0.601
pHKRange(1.8,1.9]  -49.856     81.088  -0.615    0.539
pHKRange(1.9,2]    -41.814     82.167  -0.509    0.611
pHKRange(2,2.1]    -62.000    112.262  -0.552    0.581
pHKRange(2.1,2.2]  -58.950     88.751  -0.664    0.507
pHKRange(2.2,2.3]  -17.440     86.958  -0.201    0.841
pHKRange(2.3,2.4]  -24.500     97.222  -0.252    0.801
pHKRange(2.4,2.5]  -56.000     84.862  -0.660    0.509
pHKRange(2.5,2.6]  -49.000     97.222  -0.504    0.614
pHKRange(2.6,2.7]   51.305    112.262   0.457    0.648
pHKRange(2.7,2.8]   68.500    112.262   0.610    0.542
pHKRange(2.8,2.9]  -62.000    112.262  -0.552    0.581
pHKRange(2.9,3]    -52.000    112.262  -0.463    0.643
pHKRange(3.3,3.4]  -62.000    112.262  -0.552    0.581
pHKRange(3.7,3.8]  -61.000    112.262  -0.543    0.587
pHKRange(3.8,3.9]  -62.000    112.262  -0.552    0.581

Residual standard error: 79.38 on 48608 degrees of freedom
Multiple R-squared:  0.03839,   Adjusted R-squared:  0.03778 
F-statistic:  62.6 on 31 and 48608 DF,  p-value: < 2.2e-16

test

summary(lm(Return ~ HCap + HKPrice, data = dat))

Call:
lm(formula = Return ~ HCap + HKPrice, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
 -68.50  -41.85  -24.57   13.00 2949.97 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  66.1296     1.7065   38.75   <2e-16 ***
HCap         -4.1288     0.2682  -15.39   <2e-16 ***
HKPrice     -18.2079     1.7174  -10.60   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 80.65 on 48637 degrees of freedom
Multiple R-squared:  0.006699,  Adjusted R-squared:  0.006658 
F-statistic:   164 on 2 and 48637 DF,  p-value: < 2.2e-16
summary(lm(Return ~ ipRange, data = dat))

Call:
lm(formula = Return ~ ipRange, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
-116.54  -42.61  -25.31   13.49 2945.54 

Coefficients:
                Estimate Std. Error t value Pr(>|t|)    
(Intercept)     41.50801    1.27331  32.599  < 2e-16 ***
ipRange(10,15]   4.67793    2.31126   2.024 0.042979 *  
ipRange(15,20]   3.18778    2.32662   1.370 0.170651    
ipRange(20,25]   1.33495    2.31633   0.576 0.564402    
ipRange(25,30]  -2.49469    2.30219  -1.084 0.278540    
ipRange(30,35]   0.13349    2.31310   0.058 0.953979    
ipRange(35,40]   2.60197    2.41188   1.079 0.280676    
ipRange(40,45]   1.95195    2.34688   0.832 0.405570    
ipRange(45,50]   2.31935    2.47645   0.937 0.348988    
ipRange(5,10]    1.10243    1.96256   0.562 0.574303    
ipRange(50,55]   0.11829    2.29905   0.051 0.958966    
ipRange(55,60]  -0.98648    2.38947  -0.413 0.679723    
ipRange(60,65]   0.22325    2.68400   0.083 0.933712    
ipRange(65,70]   0.46061    2.93477   0.157 0.875286    
ipRange(70,75]  -0.48891    3.17289  -0.154 0.877541    
ipRange(75,80]  -0.05228    4.08034  -0.013 0.989778    
ipRange(80,85]   4.50263    7.23165   0.623 0.533532    
ipRange(85,90]  15.27115   26.98091   0.566 0.571397    
ipRangeET       75.03649   10.43012   7.194 6.37e-13 ***
ipRangeFT      -14.20101   20.91483  -0.679 0.497146    
ipRangeHT       12.05429    2.57128   4.688 2.77e-06 ***
ipRangeNo        4.94791    1.39572   3.545 0.000393 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 80.85 on 48618 degrees of freedom
Multiple R-squared:  0.002204,  Adjusted R-squared:  0.001773 
F-statistic: 5.115 on 21 and 48618 DF,  p-value: 1.434e-13
summary(lm(Return ~ CurScore + ipHCap, data = dat))

Call:
lm(formula = Return ~ CurScore + ipHCap, data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
-210.29  -41.25  -24.27   12.94 2942.06 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  40.4134     0.7420  54.468  < 2e-16 ***
CurScore0-1   3.2969     1.6715   1.972  0.04857 *  
CurScore0-2   1.9420     3.4739   0.559  0.57615    
CurScore0-3   9.9639     9.3611   1.064  0.28716    
CurScore0-4  10.6088    22.5450   0.471  0.63796    
CurScore0-5 -11.6487    45.0722  -0.258  0.79606    
CurScore1-0   2.3152     1.5680   1.477  0.13980    
CurScore1-1   4.9467     2.3974   2.063  0.03908 *  
CurScore1-2   3.5465     3.7904   0.936  0.34946    
CurScore1-3  -5.2166    10.3647  -0.503  0.61476    
CurScore1-4  -3.2119    21.6602  -0.148  0.88212    
CurScore2-0   3.1421     2.4630   1.276  0.20207    
CurScore2-1   6.3561     4.4060   1.443  0.14914    
CurScore2-2   7.7655     7.3160   1.061  0.28850    
CurScore2-3  12.9682    11.9258   1.087  0.27686    
CurScore2-4 -14.3164    45.0698  -0.318  0.75075    
CurScore3-0   1.2109     6.2150   0.195  0.84552    
CurScore3-1   7.4008     8.5488   0.866  0.38666    
CurScore3-2   2.8428    18.9448   0.150  0.88072    
CurScore3-3  22.8109    23.5450   0.969  0.33264    
CurScore3-4 227.6231    55.1949   4.124 3.73e-05 ***
CurScore4-0   0.3637    23.5465   0.015  0.98768    
CurScore4-1   3.1720    20.8733   0.152  0.87922    
CurScore4-2  -6.6857    29.5102  -0.227  0.82077    
CurScore4-3  43.7216    78.0544   0.560  0.57539    
CurScore5-0  -8.7580    24.7024  -0.355  0.72293    
CurScore5-1 -36.0754    78.0547  -0.462  0.64395    
CurScore5-2  -3.3488    55.1995  -0.061  0.95162    
CurScore5-3  18.3565    78.0562   0.235  0.81408    
CurScoreNo    3.7381     0.9939   3.761  0.00017 ***
ipHCap       -2.8920     0.2464 -11.739  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 78.05 on 35273 degrees of freedom
  (13336 observations deleted due to missingness)
Multiple R-squared:  0.005217,  Adjusted R-squared:  0.004371 
F-statistic: 6.166 on 30 and 35273 DF,  p-value: < 2.2e-16

graph 3.4.1c linear model

## Set options back to original options
options(op)

Powered by - Copyright© Intellectual Property Rights of Scibrokes®